<?php
/**
 * Created by PhpStorm.
 * User: zyark
 * Date: 2018/3/28
 * Time: 17:38
 */

namespace app\admin\logic;


class MoneyLogic
{
    /**
     * 存储用户资金流动
     * @param $money float 变动金额
     * @param $current_money float 当前金额
     * @param $change_type int 来源
     * @param $put_type  int 收入或支出
     * @param $remark string 备注
     * @param $user_id int 用户id
     * @param $money_type int 资金类型
     * @param $source_id int
     */
    public function saveMoneyLog($money,$current_money,$change_type,$put_type,$remark,$user_id,$money_type,$source_id){
        $log['money'] = $money;
        $log['current_money'] = $current_money;
        $log['change_type'] = $change_type;
        $log['in_out_type'] = $put_type;
        $log['desc'] = $remark;
        $log['user_id'] = $user_id;
        $log['source_id'] = $source_id;
        $log['money_type'] = $money_type;
        $log['create_time'] = time();
        model('MoneyLog')->insert($log);
    }
}